package cn.uc.app;

import cn.uc.net.NetworkThread;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class InfoActivity extends Activity{
    private TextView infoTextView;
    Button btnOK;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.info);
        
        infoTextView = (TextView)findViewById(R.id.info_tv_info);
        btnOK = (Button)findViewById(R.id.info_btn_ok);       
        btnOK.setOnClickListener(new View.OnClickListener() {            
            public void onClick(View arg0) {
                // XXX Auto-generated method stub
                
                Intent sIntent = new Intent();
                sIntent.setClass(InfoActivity.this, MDiaryActivity.class);
//                Bundle data = new Bundle();
//                data.putString("type", "Text");
//                data.putString("title", editTitle.getText().toString());
//                data.putString("content", editContent.getText().toString());
//                sIntent.putExtras(data);
                startActivity(sIntent);
//                InfoActivity.this.setResult(RESULT_OK, sIntent);  
            
                InfoActivity.this.finish();
            }
        });
        
        NetworkThread workThread = new NetworkThread();
        workThread.setOnReceive(new NetworkThread.OnReceive() {
            
            public void onReceive(String data) {
                // XXX Auto-generated method stub
                infoTextView.setText(data);
            }
        });
        workThread.start();
    }
}

